#include<stdio.h>
int main()
{
    int a,b,c,i,d = -1;
    scanf_s("%d", &i);
    if (i < 100)
        printf("%d", d);
    c = i % 100;
    b = (i / 10) % 10;
    a = i / 100;
    if (a != 0)
    {
        if (i == a * a * a + b * b * b + c * c * c)
            printf("YES");
        else  printf("NO");
    }
        return 0;
}